package com.xlh.wjdcserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.property.dto.PermissionAddDTO;
import com.property.entity.Permission;
import com.property.entity.Role;
import com.property.vo.PermissionVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select * from t_permission")
    List<Permission> permissionList();

    void addPermission(PermissionAddDTO permissionAddDTO);

    @Select("select * from per_role where role_id = #{roleId}")
    List<PermissionVO> getPerByRoleId(String roleId);

    @Delete("delete from per_role where role_id = #{roleId}")
    void deletePermission(String roleId);
}
